<include file="Public:header" />
<include file="Public:menu" />
<include file="Public:navibar" /><br />
<div>
    <div>
        <switch name="select">
            <case value="add">
                <h4>新昵称添加</h4>
                <div class="account_settings page grid box1">
                    <form action="__URL__/adds" method="post" enctype="multipart/form-data">
                        1.添加单个昵称&nbsp;<input type="radio" name="choice" value="single" /><br />
                        <div class="col1">
                            <label class="label input_horizontal">昵称</label>
                        </div>
                        <div class="col2">
                            <input class="text" type="text" name="nickname" value="" /><br />
                        </div>

                        2.批量添加昵称&nbsp;<input type="radio" name="choice" value="some" />
                        <div class="col2">
                            <input type="file"  name="file" value="" /><br /><br />
                            <button class="btn btn_silver fbold" type="submit" onClick="if (confirm('是否确认提交？'))this.form.submit();return false;"><span>提交</span></button><br />
                        </div>
                    </form>
                </div>
            </case>
        
            <case value="update">
                <div class="account_settings page grid box1">
                    <h4>昵称编辑</h4>
                    <div class="col1">
                        <label class="label input_horizontal">ID</label>
                        <label class="label input_horizontal">昵称</label>
                        <label class="label input_horizontal">状态</label>
                    </div>
                    <div class="col2">
                        <form action="__URL__/updates" method="post">
                            <input class="text" name="name_id" value="{{$name.name_id}}" /><br />
                            <input class="text" type="text" name="nickname" value="{{$name.nickname}}" /><br />
                            <input type="checkbox" name="status" value="1" <if condition="$name.status eq 1" >checked="checked"</if> />&nbsp;正常<br /><br />
                            <button class="btn btn_silver fbold" type="submit" onClick="if (confirm('是否确认提交？'))this.form.submit();return false;"><span>提交</span></button>
                        </form>
                    </div>
                </div>
            </case>
            
        <default />
            <h4>昵称库管理</h4>
            <hr>
            <include file="Public:searchbar" /> 
            <form action="__URL__/delete" method="post">
                <table border="1" width="100%">
                    <tr>
                        <th><input type="checkbox" name="checkbox" onclick="" /></th>
                        <th>ID</th>
                        <th>昵称</th>
                        <th>状态</th>
                        <th>操作</th>
                    </tr>
                    <volist name="nickname" id="vo">
                        <tr>
                            <td><input name="id[]" type="checkbox" id="id[]" value="{{$vo.name_id}}" /></td>
                            <td>{{$vo.name_id}}</td>
                            <td>{{$vo.nickname}}</td>
                            <td><if condition="$vo.status neq 1">禁用<else />正常</if></td>
                            <td><input type="button"  value="编辑"  onClick="location.href='__URL__/update/name_id/{{$vo.name_id}}';" ></td>
                        </tr>
                    </volist>
                    <tr>
                        <td colspan="6" align="left">
                            <input type="button"  value="删除"  onClick="if (confirm('是否确认提交？'))this.form.submit();return false;" /> 
                            <input type="button"  value="添加"  onClick="location.href='__URL__/add';" /> 
                        </td>
                    </tr>
                </table>
            </form>
            <include file="Public:paging" />
        </switch>
    </div>
    
</div>
<include file="Public:footer" />